package com.wutuo.contact.provider.enums;

public enum ContactType {

    PARENT("parent"), WORKMATE("teacher"), OTHER("other");

    private String value;

    /**
     * 私有构造函数
     *
     * @param n
     */
    private ContactType(String value) {
        this.value = value;
    }

    /**
     * 返回枚举值的字符串值
     *
     * @return
     */
    public String getValue() {
        return value;
    }

    public static ContactType get(String value) {
        ContactType[] values = ContactType.values();
        for (ContactType item : values) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return OTHER;
    }
}
